package cn.webrx;

import org.apache.commons.lang3.StringUtils;

public class SuOk {
    public static void main(String[] args) {
        String str = "hello java 123";
        System.out.println(str);
        System.out.println(StringUtils.reverse(str));

        System.out.println(StringUtils.difference("好好学习天天向上", "好好天天"));

        System.out.println(StringUtils.abbreviate("要地要要工要，好好学习天天向上，好好学习天天向上。", "###",10));

        String s = "要地";
        System.out.println(s);
        System.out.println(s.length()>10 ? s.substring(0,7).concat("...") : s);

        System.out.println(StringUtils.center("*",20));
        System.out.println(StringUtils.center("***",20));
        System.out.println(StringUtils.center("*****",20));
        for (int i = 1; i < 25; i+=2) {
            System.out.println(StringUtils.center("*".repeat(i),30));
        }
        for (int i = 21; i >=1; i-=2) {
            System.out.println(StringUtils.center("*".repeat(i),30));
        }
    }

}
